package vista;
import java.awt.BorderLayout;
import java.awt.event.ActionListener;

import javax.swing.BorderFactory;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JTable;
import javax.swing.JTextField;

import javax.swing.WindowConstants;
import javax.swing.border.LineBorder;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;
import javax.swing.SwingUtilities;

import bean.BtSacfre;
import bean.TablaPlus;
import bean.TxtEscribirLetras;
import bean.TxtEscribirLetrasEspaciosNumeros;
import bean.TxtEscribirLetrasNumeros;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class frmGestionarUsuario extends javax.swing.JFrame {
	private JPanel pndatos;
	private JPanel pnusuario;
	private TablaPlus tbusuarios;
	private JLabel lblusuarios;
	private JLabel lblapellido;
	private TxtEscribirLetras txtapellido;
	private TxtEscribirLetras txtnombre;
	private JLabel lblnombre;
	private TxtEscribirLetras txtid;
	private JLabel lblid;
	private  BtSacfre btmodificar;
	private BtSacfre bteliminar;
	private BtSacfre btcancelar;
	private BtSacfre btregistrar;
	private JLabel lblconfirmacion1;
	private JPasswordField passw3;
	private JLabel lblconfirmacionpass;
	private JLabel lblnuevopass;
	private JPasswordField passw2;
	private JPasswordField passw1;
	private BtSacfre btbuscar;
	private JLabel lblpassword;
	private JOptionPane mensaje;

	/**
	* Auto-generated main method to display this JFrame
	*/
	public static void main(String[] args) {
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				frmGestionarUsuario inst = new frmGestionarUsuario();
				inst.setLocationRelativeTo(null);
				inst.setVisible(true);
			}
		});
	}
	
	public frmGestionarUsuario() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			getContentPane().setBackground(new java.awt.Color(225,225,225));
			this.setTitle("SACFRE/Gestionar Usuario");
			this.setResizable(false);
			{
				pndatos = new JPanel();
				getContentPane().add(pndatos, BorderLayout.CENTER);
				pndatos.setLayout(null);
				pndatos.setBackground(new java.awt.Color(239,171,183));
				pndatos.setPreferredSize(new java.awt.Dimension(953, 388));
				{
					pnusuario = new JPanel();
					pndatos.add(pnusuario);
					pnusuario.setBounds(12, 12, 935, 294);
					pnusuario.setBackground(new java.awt.Color(255,219,225));
					pnusuario.setLayout(null);
					pnusuario.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false));
					{
						String[] nombres_columnas = { "Id", "Nombres" ,"Apellidos" } ;
						tbusuarios = new TablaPlus();
						tbusuarios.setBounds(528, 57, 392, 179);
						pnusuario.add(tbusuarios);
						tbusuarios.setTablaPlus(nombres_columnas);
						tbusuarios.setFont(new java.awt.Font("FreeSerif",1,14));
						tbusuarios.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false));
					}
					{
						lblusuarios = new JLabel();
						pnusuario.add(lblusuarios);
						lblusuarios.setText("Usuarios");
						lblusuarios.setBounds(691, 34, 94, 15);
						lblusuarios.setFont(new java.awt.Font("FreeSerif",1,16));
					}
					{
						lblid = new JLabel();
						pnusuario.add(lblid);
						lblid.setText("Id:");
						lblid.setBounds(159, 19, 24, 20);
						lblid.setFont(new java.awt.Font("FreeSerif",1,16));
					}
					{
						txtid = new TxtEscribirLetras();
						pnusuario.add(txtid);
						txtid.setBounds(190, 11, 283, 35);
					}
					{
						lblnombre = new JLabel();
						pnusuario.add(lblnombre);
						lblnombre.setText("Nombres:");
						lblnombre.setBounds(107, 64, 84, 15);
						lblnombre.setFont(new java.awt.Font("FreeSerif",1,16));
					}
					{
						txtnombre = new TxtEscribirLetras();
						pnusuario.add(txtnombre);
						txtnombre.setBounds(190, 54, 318, 35);
					}
					{
						lblapellido = new JLabel();
						pnusuario.add(lblapellido);
						lblapellido.setText("Apellidos:");
						lblapellido.setBounds(106, 107, 84, 15);
						lblapellido.setFont(new java.awt.Font("FreeSerif",1,16));
					}
					{
						txtapellido = new TxtEscribirLetras();
						pnusuario.add(txtapellido);
						txtapellido.setBounds(190, 97, 317, 35);
					}
					{
						lblpassword = new JLabel();
						pnusuario.add(lblpassword);
						lblpassword.setText("Password:");
						lblpassword.setBounds(103, 162, 84, 15);
						lblpassword.setFont(new java.awt.Font("FreeSerif",1,16));
					}
					{
						btbuscar = new BtSacfre();
						pnusuario.add(btbuscar);
						btbuscar.setBounds(479, 11, 32, 36);
						btbuscar.setIcon(new ImageIcon(getClass().getClassLoader().getResource("Iconos/search_user.png")));
					}
					{
						passw1 = new JPasswordField();
						pnusuario.add(getPassw1());
						passw1.setBounds(189, 153, 320, 36);
						passw1.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false));
					}
					{
						passw2 = new JPasswordField();
						pnusuario.add(getPassw2());
						passw2.setBounds(190, 201, 320, 35);
						passw2.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false));
					}
					{
						lblnuevopass = new JLabel();
						pnusuario.add(getLblnuevopass());
						lblnuevopass.setText("Nuevo Password:");
						lblnuevopass.setBounds(46, 211, 146, 13);
						lblnuevopass.setFont(new java.awt.Font("FreeSerif",1,16));
					}
					{
						lblconfirmacionpass = new JLabel();
						pnusuario.add(lblconfirmacionpass);
						lblconfirmacionpass.setText("Confirmacion  de Nuevo");
						lblconfirmacionpass.setBounds(6, 248, 189, 14);
						lblconfirmacionpass.setFont(new java.awt.Font("FreeSerif",1,16));
					}
					{
						lblconfirmacion1 = new JLabel();
						pnusuario.add(getLblconfirmacion1());
						lblconfirmacion1.setText("Password:");
						lblconfirmacion1.setBounds(109, 262, 86, 15);
						lblconfirmacion1.setFont(new java.awt.Font("FreeSerif",1,16));
					}
					{
						passw3 = new JPasswordField();
						pnusuario.add(getPassw3());
						passw3.setBounds(192, 248, 318, 34);
						passw3.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false));
					}
					{
						bteliminar = new BtSacfre();
						pndatos.add(bteliminar);
						bteliminar.setText("Eliminar");
						bteliminar.setBounds(657, 316, 141, 58);
						bteliminar.setIcon(new ImageIcon(getClass().getClassLoader().getResource("Iconos/delete_user.png")));
					}
					{
						btmodificar = new BtSacfre();
						pndatos.add(btmodificar);
						btmodificar.setText("Modificar");
						btmodificar.setBounds(510, 316, 141, 58);
						btmodificar.setIcon(new ImageIcon(getClass().getClassLoader().getResource("Iconos/edit_profile.png")));
					}
					{
						btcancelar = new BtSacfre();
						pndatos.add(btcancelar);
						btcancelar.setText("Cancelar");
						btcancelar.setBounds(804, 316, 141, 58);
						btcancelar.setIcon(new ImageIcon(getClass().getClassLoader().getResource("Iconos/delete.png")));
					}
					{
						btregistrar = new BtSacfre();
						pndatos.add(btregistrar);
						btregistrar.setText("Registrar");
						btregistrar.setBounds(363, 317, 141, 58);
						btregistrar.setIcon(new ImageIcon(getClass().getClassLoader().getResource("Iconos/add_user.png")));
					}
				}
			}
			pack();
			this.setSize(968, 418);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}

	public JPanel getPndatos() {
		return pndatos;
	}

	public JPanel getPnusuario() {
		return pnusuario;
	}

	public TablaPlus getTbusuarios() {
		return tbusuarios;
	}

	public JLabel getLblusuarios() {
		return lblusuarios;
	}

	public JLabel getLblapellido() {
		return lblapellido;
	}

	public TxtEscribirLetras getTxtapellido() {
		return txtapellido;
	}

	public TxtEscribirLetras getTxtnombre() {
		return txtnombre;
	}

	public JLabel getLblnombre() {
		return lblnombre;
	}

	public TxtEscribirLetras getTxtid() {
		return txtid;
	}

	public JLabel getLblid() {
		return lblid;
	}

	public BtSacfre getBtmodificar() {
		return btmodificar;
	}

	public BtSacfre getBteliminar() {
		return bteliminar;
	}

	public BtSacfre getBtcancelar() {
		return btcancelar;
	}

	public BtSacfre getBtregistrar() {
		return btregistrar;
	}

	public JLabel getLblpassword() {
		return lblpassword;
	}
	
	public BtSacfre getBtbuscar() {
		return btbuscar;
	}

	public void AgregarEscuchadores(ActionListener actionlistener){
		this.btregistrar.addActionListener(actionlistener);
		this.btmodificar.addActionListener(actionlistener);
		this.bteliminar.addActionListener(actionlistener);
		this.btcancelar.addActionListener(actionlistener);
		this.btbuscar.addActionListener(actionlistener);
		
	}
	
	public JPasswordField getPassw1() {
		return passw1;
	}
	
	public JPasswordField getPassw2() {
		return passw2;
	}
	
	public JLabel getLblnuevopass() {
		return lblnuevopass;
	}
	
	public JLabel getLblconfirmacion1() {
		return lblconfirmacion1;
	}
	
	public JPasswordField getPassw3() {
		return passw3;
	}

	public JLabel getLblconfirmacionpass() {
		return lblconfirmacionpass;
	}

	public JOptionPane getMensaje() {
		return mensaje;
	}

}
